package cc.w3d.jawos.apps.artiks.client.widgets;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;

public class ToolBar extends Composite
{
	HorizontalPanel toolBar = new HorizontalPanel();
	private HTML separator = new HTML("<div style='width:100%; height:18px; background-color:#9999FF;'>&nbsp;</div>");

	public ToolBar()
	{
		toolBar.add(separator);

		toolBar.setWidth("100%");

		separator.setWidth("100%");
		toolBar.setCellWidth(separator, "100%");

		initWidget(toolBar);
		this.setWidth("100%");
	}

	public void addChild(ToolBarButton button)
	{
		toolBar.insert(button, toolBar.getWidgetIndex(separator));
		button.setToolBar(this);
	}

	public void addRightChild(ToolBarButton button)
	{
		toolBar.add(button);
		button.setToolBar(this);
	}
}
